<?php
namespace Mobile\Controller;
class DemoController extends PublicController{
	function list(){
        $demoOb = M("M_demo");
        $arr = $demoOb->limit(10)->select();
        $this->assign('arr',$arr);
		$this->display();
	}
	function style(){
        $demoOb = M("M_demo");
        $arr = $demoOb->limit(10)->select();
        $this->assign('arr',$arr);
		$this->display();
	}
	function yusuan(){
        $demoOb = M("M_demo");
        $arr = $demoOb->limit(10)->select();
        $this->assign('arr',$arr);
		$this->display();
	}
	function h_yiju(){
	    $demoOb = M("M_demo");
	    $arr = $demoOb->where("huxing='一居室'")->limit(10)->select();
	    $this->assign('arr',$arr);
	    $this->display();
    }
    function h_erju(){
        $demoOb = M("M_demo");
        $arr = $demoOb->where("huxing='二居室'")->limit(10)->select();
        $this->assign('arr',$arr);
        $this->display();
    }
    function h_sanju(){
        $demoOb = M("M_demo");
        $arr = $demoOb->where("huxing='三居室'")->limit(10)->select();
        $this->assign('arr',$arr);
        $this->display();
    }
    function h_siju(){
        $demoOb = M("M_demo");
        $arr = $demoOb->where("huxing='四居室'")->limit(10)->select();
        $this->assign('arr',$arr);
        $this->display();
    }
    function h_bieshu(){
        $demoOb = M("M_demo");
        $arr = $demoOb->where("huxing='别墅'")->limit(10)->select();
        $this->assign('arr',$arr);
        $this->display();
    }
    function h_gongyu(){
        $demoOb = M("M_demo");
        $arr = $demoOb->where("huxing='公寓'")->limit(10)->select();
        $this->assign('arr',$arr);
        $this->display();
    }
    function f_meishi(){
	    $demoOb=M("M_demo");
	    $arr=$demoOb->where("style='美式'")->limit(10)->select();
	    $this->assign('arr',$arr);
	    $this->display();
	}
    function f_oushi(){
        $demoOb=M("M_demo");
        $arr=$demoOb->where("style='欧式'")->limit(10)->select();
        $this->assign('arr',$arr);
        $this->display();
    }
    function f_dizhonghai(){
        $demoOb=M("M_demo");
        $arr=$demoOb->where("style='地中海'")->limit(10)->select();
        $this->assign('arr',$arr);
        $this->display();
    }
    function f_tianyuan(){
        $demoOb=M("M_demo");
        $arr=$demoOb->where("style='田园'")->limit(10)->select();
        $this->assign('arr',$arr);
        $this->display();
    }
    function f_zhongshi(){
        $demoOb=M("M_demo");
        $arr=$demoOb->where("style='中式'")->limit(10)->select();
        $this->assign('arr',$arr);
        $this->display();
    }
    function f_jianyue(){
        $demoOb=M("M_demo");
        $arr=$demoOb->where("style='简约'")->limit(10)->select();
        $this->assign('arr',$arr);
        $this->display();
    }
    function f_dongnanya(){
        $demoOb=M("M_demo");
        $arr=$demoOb->where("style='东南亚'")->limit(10)->select();
        $this->assign('arr',$arr);
        $this->display();
    }
    function f_rishi(){
        $demoOb=M("M_demo");
        $arr=$demoOb->where("style='日式'")->limit(10)->select();
        $this->assign('arr',$arr);
        $this->display();
    }
    function f_xingudian(){
        $demoOb=M("M_demo");
        $arr=$demoOb->where("style='新古典'")->limit(10)->select();
        $this->assign('arr',$arr);
        $this->display();
    }
    function y_5(){
        $demoOb=M("M_demo");
        $arr=$demoOb->where("price<=5")->limit(10)->select();

        $this->assign('arr',$arr);
        $this->display();
    }
    function y_5_8(){
        $demoOb=M("M_demo");
        $arr=$demoOb->where("price<=8 and price>=5")->limit(10)->select();
        $this->assign('arr',$arr);
        $this->display();
    }
    function y_8(){
        $demoOb=M("M_demo");
        $arr=$demoOb->where('price >= 8')->limit(10)->select();

        $this->assign('arr',$arr);
        $this->display();
    }
    function detail(){
        $maxOb = M("Maxlist");
        $tarr = $maxOb->where("id<6")->select();
        $darr = $maxOb->where("id>5")->select();
        $this->assign('tarr',$tarr);
        $this->assign('darr',$darr);
        $Ob = M("M_demo");
        $id=$_GET['id'];
        $arr = $Ob->where("id=$id")->select();
        if($arr){
           echo json_encode(res);
        }
        $this->assign('arr',$arr);
        $this->display();
    }

}